@extends('admin.layout.base')

@section('main')
    <h1 class="page-header">编辑分类</h1>
    @if (count($errors) > 0)
        <div class="alert alert-danger">
            <strong>糟糕!</strong> 发生以下错误<br><br>
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif
    <form action="{{ route('admin.categories.update', $game->id) }}" method="post">
        <div class="col-md-9">

            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <input type="hidden" name="_method" value="PATCH">

            <div class="form-group">
                <label>图标地址</label>
                <input type="url" class="form-control" name="icon" placeholder=""
                       value="{{ $category->icon }}">
            </div>
            <div class="form-group">
                <label>名字</label>
                <input type="text" class="form-control" name="name" placeholder=""
                       value="{{ $category->name }}">
            </div>
            <div class="form-group">
                <label>别名</label>
                <input type="text" class="form-control" name="slug" placeholder=""
                       value="{{ $category->slug }}">
            </div>
            <div class="form-group">
                <label>详情介绍</label>
                    <textarea class="form-control" placeholder="详细介绍" name="description"
                              rows="5">{{ $category->description }}</textarea>
            </div>
        </div>
        <div class="col-md-3">
            <div class="panel panel-default">
                <div class="panel-heading">保存</div>
                <div class="panel-body">

                </div>
                <div class="panel-footer">
                    <button type="submit" class="btn btn-primary">更新分类</button>
                </div>
            </div>
        </div>
    </form>
@stop